<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="no"/>

	<xsl:template match="/">
	   <html>
	   		<head>
	   			<title>Система электронного документооборота</title>
	   			 <link type="text/css" href="/jbpm-rest/resources/css/contingent.css" rel="stylesheet" media="screen" />
	   			 <script src="/jbpm-rest/resources/js/jquery-1.3.2.js" type="text/javascript"></script>
	   			 <script src="/jbpm-rest/resources/js/jquery.form.js" type="text/javascript"></script>
	   			 <script src="/jbpm-rest/resources/js/definitions.js" type="text/javascript"></script>
	   		</head>
	   		<body>
	   		<xsl:apply-templates />
	   		</body>
	   </html>
	</xsl:template>
	
	<xsl:template match="definitionList">
		<div id="definitionsList">
			<div class="title">Список определений процессов</div>
			<table class="students-table">
                <colgroup>
                        <col style="width:20px;"/>
                        <col style="width:4.5em;"/>
                        <col style="width:4.5em;"/>
                        <col style="width:5.6em;"/>

                </colgroup>
                <tbody>
                	<tr>
	                    <td>Название</td>
	                    <td>Версия</td>
	                    
	                </tr>
					<xsl:for-each select="definition">
						<xsl:variable name="class">
	                        <xsl:choose>
	                                <xsl:when test="position() mod 2 = 0">tr_even</xsl:when>
	                                <xsl:otherwise>tr_odd</xsl:otherwise>
	                        </xsl:choose>
                        </xsl:variable>
						<tr class="{$class}">
							<td><a href="{deployment/@ref}"><xsl:value-of select="name"/></a></td>
							<td><a href="{deployment/@ref}"><xsl:value-of select="version"/></a></td>
						</tr>
					</xsl:for-each>
				</tbody>
			</table>
			
			<form id="upload_definition" action="deploy" method="post" enctype="multipart/form-data">
				<input type="file" name="file" accept="text/xml"/>
				<input type="hidden" name="name" value="foo.jpdl.xml"/>
				
				<input type="submit"/>
			</form>
			
		</div>
	</xsl:template>
	

</xsl:stylesheet>